package com.caiheng.api.entity.product;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;

import java.io.Serializable;
import java.math.BigDecimal;
import java.util.Date;

@Data
@TableName(value = "product_order_info")
public class ProductOrderInfo implements Serializable {
    @TableId(type = IdType.AUTO)
    private Long id;

    private Integer propertyId;

    private Integer estateId;

    /**
     * 商户ID
     */
    private Integer merId;

    private Long orderId;

    private Integer productId;

    private Integer skuId;

    private String skuName;

    private Integer count;

    // 核销码
    private String verifyCode;

    private Integer isVerify;

    //已经核销的数量
    private Integer verifyCount;

    private BigDecimal singlePrice;

    private BigDecimal originPrice;

    @JsonFormat(pattern="yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    private Date createTime;

    private Integer state;

    private BigDecimal totalMoney;

    private BigDecimal activityMinsMoney;

    private BigDecimal splitMoney;
    //是否已经分成
    private Integer isFc;
    //业主分成比例
    private BigDecimal proprietorRate;
    //业主分成
    private BigDecimal proprietorSplit;
    //物业分成比例
    private BigDecimal propertyRate;
    //物业分成
    private BigDecimal propertySplit;
    //平台分成比例
    private BigDecimal platformRate;
    //平台分成
    private BigDecimal platformSplit;

    private BigDecimal merRate;
    // 商家手续费
    private BigDecimal merFee;
    //商家结算金额
    private BigDecimal merSettlement;

    /**
     * 清算状态 0 - 未清算  1 - 已清算
     */
    private int settlementState;

    /**
     * 清算状态 0 - 未清算  1 - 清算时间
     */
    @JsonFormat(pattern="yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    private Date settlementTime;

    //核销二维码
    private String qrCode;

    //二维码的创建时间  1分钟有效期
    @JsonFormat(pattern="yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    private Date codeExpireTime;


    private Long opSysUserId;
    private String opSysUserName;

    private Integer isDel;
    private Long delSysUserId;
    private String delSysUserName;
    private Date delTime;


    @TableField(exist = false)
    private String imgUrl;

    @TableField(exist = false)
    private String productName;


    @TableField(exist = false)
    private ProductAttrValue attrValue;

    /**
     *  新添加的订单详情数， 比如 客服加菜的时候 添加的数量是 之前点过的菜 的数量
     */
    @TableField(exist = false)
    private Integer addCount;

}
